package com.sina.weibo;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.IBinder;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.TextView;
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

public class SearchSquareActivity extends BaseActivity
{
  public static final String SEARCHKEYWORDLISTPATH = "/searchkeywordlistcache";
  private static final int SEARCH_MBLOG = 1;
  private static final int SEARCH_USER;
  private String keyword = null;
  private ArrayAdapter<String> keywordAdapter;
  HashSet<String> keywords;
  List<String> kwsList;
  private AutoCompleteTextView mActvKeyword;
  private Button mBtnSearch;
  private RadioButton mRbSearchUser;
  private RadioButton mRbSearchWeibo;
  private SquareItemAdapter mSquareItemAdapter;
  private ListView mlvSquare;
  private int searchFlag = 1;
  private String[] squareItems;

  public boolean dispatchKeyEvent(KeyEvent paramKeyEvent)
  {
    boolean bool;
    if (paramKeyEvent.getKeyCode() != 84)
      bool = super.dispatchKeyEvent(paramKeyEvent);
    while (true)
    {
      return bool;
      if (super.dispatchKeyEvent(paramKeyEvent))
      {
        bool = false;
        continue;
      }
      bool = true;
    }
  }

  protected void handleTitleBarEvent(int paramInt)
  {
  }

  public void hideKeyBoard(EditText paramEditText)
  {
    InputMethodManager localInputMethodManager = (InputMethodManager)getSystemService("input_method");
    IBinder localIBinder = paramEditText.getWindowToken();
    boolean bool = localInputMethodManager.hideSoftInputFromWindow(localIBinder, 2);
  }

  protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    super.onActivityResult(paramInt1, paramInt2, paramIntent);
    switch (paramInt1)
    {
    default:
    case 0:
    }
    while (true)
    {
      return;
      this.mActvKeyword.setText("");
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setView(2130903079);
    String str1 = getString(2131427358);
    setTitleBar(1, null, str1, null);
    String[] arrayOfString = new String[3];
    String str2 = getResources().getString(2131427416);
    arrayOfString[0] = str2;
    String str3 = getResources().getString(2131427417);
    arrayOfString[1] = str3;
    String str4 = getResources().getString(2131427418);
    arrayOfString[2] = str4;
    this.squareItems = arrayOfString;
    SquareItemAdapter localSquareItemAdapter1 = new SquareItemAdapter(this);
    this.mSquareItemAdapter = localSquareItemAdapter1;
    ListView localListView1 = (ListView)findViewById(2131624119);
    this.mlvSquare = localListView1;
    this.mlvSquare.setDivider(null);
    ListView localListView2 = this.mlvSquare;
    SquareItemAdapter localSquareItemAdapter2 = this.mSquareItemAdapter;
    localListView2.setAdapter(localSquareItemAdapter2);
    ListView localListView3 = this.mlvSquare;
    SearchSquareActivity.1 local1 = new SearchSquareActivity.1(this);
    localListView3.setOnItemClickListener(local1);
    AutoCompleteTextView localAutoCompleteTextView1 = (AutoCompleteTextView)findViewById(2131624033);
    this.mActvKeyword = localAutoCompleteTextView1;
    String str5 = String.valueOf(getCacheDir().getAbsolutePath());
    HashSet localHashSet1 = (HashSet)Utils.loadUsrnameList(str5 + "/searchkeywordlistcache");
    this.keywords = localHashSet1;
    if (this.keywords == null);
    for (HashSet localHashSet2 = new HashSet(); ; localHashSet2 = this.keywords)
    {
      this.keywords = localHashSet2;
      AutoCompleteTextView localAutoCompleteTextView2 = this.mActvKeyword;
      HashSet localHashSet3 = this.keywords;
      ArrayList localArrayList = new ArrayList(localHashSet3);
      this.kwsList = localArrayList;
      ArrayAdapter localArrayAdapter = new ArrayAdapter(this, 17367050, localArrayList);
      this.keywordAdapter = localArrayAdapter;
      localAutoCompleteTextView2.setAdapter(localArrayAdapter);
      Button localButton1 = (Button)findViewById(2131624034);
      this.mBtnSearch = localButton1;
      Button localButton2 = this.mBtnSearch;
      SearchSquareActivity.2 local2 = new SearchSquareActivity.2(this);
      localButton2.setOnClickListener(local2);
      RadioButton localRadioButton1 = (RadioButton)findViewById(2131624037);
      this.mRbSearchUser = localRadioButton1;
      RadioButton localRadioButton2 = this.mRbSearchUser;
      SearchSquareActivity.3 local3 = new SearchSquareActivity.3(this);
      localRadioButton2.setOnCheckedChangeListener(local3);
      RadioButton localRadioButton3 = (RadioButton)findViewById(2131624036);
      this.mRbSearchWeibo = localRadioButton3;
      this.mRbSearchWeibo.setChecked(1);
      RadioButton localRadioButton4 = this.mRbSearchWeibo;
      SearchSquareActivity.4 local4 = new SearchSquareActivity.4(this);
      localRadioButton4.setOnCheckedChangeListener(local4);
      return;
    }
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if (paramInt == 4)
    {
      AlertDialog.Builder localBuilder1 = new AlertDialog.Builder(this);
      AlertDialog.Builder localBuilder2 = localBuilder1.setTitle(2131427444).setIcon(2130837926).setCancelable(0);
      SearchSquareActivity.5 local5 = new SearchSquareActivity.5(this);
      AlertDialog.Builder localBuilder3 = localBuilder2.setPositiveButton(2131427441, local5);
      SearchSquareActivity.6 local6 = new SearchSquareActivity.6(this);
      AlertDialog.Builder localBuilder4 = localBuilder3.setNegativeButton(2131427436, local6);
      AlertDialog localAlertDialog = localBuilder1.show();
    }
    boolean bool;
    for (int i = 1; ; bool = super.onKeyDown(paramInt, paramKeyEvent))
      return i;
  }

  class SquareItemAdapter extends BaseAdapter
  {
    Context context;
    TextView tvName;

    public SquareItemAdapter(Context arg2)
    {
      Object localObject;
      this.context = localObject;
    }

    public int getCount()
    {
      return 3;
    }

    public Object getItem(int paramInt)
    {
      return Integer.valueOf(paramInt);
    }

    public long getItemId(int paramInt)
    {
      return paramInt;
    }

    public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
    {
      View localView = ((LayoutInflater)this.context.getSystemService("layout_inflater")).inflate(2130903081, null);
      TextView localTextView1 = (TextView)localView.findViewById(2131623996);
      this.tvName = localTextView1;
      if (paramInt == 0)
      {
        TextView localTextView2 = this.tvName;
        String str1 = SearchSquareActivity.this.getString(2131427416);
        localTextView2.setText(str1);
        localView.setBackgroundResource(2130837576);
      }
      while (true)
      {
        return localView;
        if (paramInt == 1)
        {
          TextView localTextView3 = this.tvName;
          String str2 = SearchSquareActivity.this.getString(2131427417);
          localTextView3.setText(str2);
          localView.setBackgroundResource(2130837568);
          continue;
        }
        if (paramInt != 2)
          continue;
        TextView localTextView4 = this.tvName;
        String str3 = SearchSquareActivity.this.getString(2131427418);
        localTextView4.setText(str3);
        localView.setBackgroundResource(2130837563);
      }
    }
  }

  class ViewHolder
  {
    ImageView iv;
    TextView tv;

    ViewHolder()
    {
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     com.sina.weibo.SearchSquareActivity
 * JD-Core Version:    0.6.0
 */